package httpx

import "net/http"

//type Client struct {
//	*http.Client
//	R *Request
//}
//
//func NewClient(timeout time.Duration) *Client {
//	return &Client{Client: &http.Client{Timeout: timeout}}
//}
//
//func (c *Client) Request(method, URL string, options ...Option) (*Client, error) {
//	r, err := newRequest(method, URL, options...)
//	if err != nil {
//		return nil, err
//	}
//	c.R = r
//	return c, nil
//}
//
//func (c *Client) Do() (*Response, error) {
//	req, err := c.R.Parse()
//	if err != nil {
//		return nil, err
//	}
//	response, err := c.Client.Do(req)
//	if err != nil {
//		return nil, err
//	}
//	return newResponse(response)
//}
//
//func (c *Client) Get(URL string, options ...Option) (*Client, error) {
//	return c.Request(http.MethodGet, URL, options...)
//}
//
//func (c *Client) Post(URL string, options ...Option) (*Client, error) {
//	return c.Request(http.MethodPost, URL, options...)
//}
//
//func (c *Client) Put(URL string, options ...Option) (*Client, error) {
//	return c.Request(http.MethodPut, URL, options...)
//}
//
//func (c *Client) Patch(URL string, options ...Option) (*Client, error) {
//	return c.Request(http.MethodPatch, URL, options...)
//}
//
//func (c *Client) Delete(URL string, options ...Option) (*Client, error) {
//	return c.Request(http.MethodDelete, URL, options...)
//}
//
//func (c *Client) Option(URL string, options ...Option) (*Client, error) {
//	return c.Request(http.MethodOptions, URL, options...)
//}
//
//func (c *Client) Trace(URL string, options ...Option) (*Client, error) {
//	return c.Request(http.MethodTrace, URL, options...)
//}
//
//func (c *Client) DoRequest(method, URL string, options ...Option) (*Response, error) {
//	client, err := c.Request(method, URL, options...)
//	if err != nil {
//		return nil, err
//	}
//	return client.Do()
//}
//
//func (c *Client) DoGet(URL string, options ...Option) (*Response, error) {
//	client, err := c.Request(http.MethodGet, URL, options...)
//	if err != nil {
//		return nil, err
//	}
//	return client.Do()
//}
//
//func (c *Client) DoPost(URL string, options ...Option) (*Response, error) {
//	client, err := c.Request(http.MethodPost, URL, options...)
//	if err != nil {
//		return nil, err
//	}
//	return client.Do()
//}
//
//func (c *Client) DoPut(URL string, options ...Option) (*Response, error) {
//	client, err := c.Request(http.MethodPut, URL, options...)
//	if err != nil {
//		return nil, err
//	}
//	return client.Do()
//}
//
//func (c *Client) DoPatch(URL string, options ...Option) (*Response, error) {
//	client, err := c.Request(http.MethodPatch, URL, options...)
//	if err != nil {
//		return nil, err
//	}
//	return client.Do()
//}
//
//func (c *Client) DoDelete(URL string, options ...Option) (*Response, error) {
//	client, err := c.Request(http.MethodDelete, URL, options...)
//	if err != nil {
//		return nil, err
//	}
//	return client.Do()
//}
//
//func (c *Client) DoOption(URL string, options ...Option) (*Response, error) {
//	client, err := c.Request(http.MethodOptions, URL, options...)
//	if err != nil {
//		return nil, err
//	}
//	return client.Do()
//}
//
//func (c *Client) DoTrace(URL string, options ...Option) (*Response, error) {
//	client, err := c.Request(http.MethodTrace, URL, options...)
//	if err != nil {
//		return nil, err
//	}
//	return client.Do()
//}

func Get(url string, options ...Option) (*Response, error) {
	request, err := NewRequest(http.MethodGet, url, options...)
	if err != nil {
		return nil, err
	}
	return request.Do()
}

func Post(url string, options ...Option) (*Response, error) {
	request, err := NewRequest(http.MethodPost, url, options...)
	if err != nil {
		return nil, err
	}
	return request.Do()
}

func Put(url string, options ...Option) (*Response, error) {
	request, err := NewRequest(http.MethodPut, url, options...)
	if err != nil {
		return nil, err
	}
	return request.Do()
}

func Patch(url string, options ...Option) (*Response, error) {
	request, err := NewRequest(http.MethodPatch, url, options...)
	if err != nil {
		return nil, err
	}
	return request.Do()
}

func Delete(url string, options ...Option) (*Response, error) {
	request, err := NewRequest(http.MethodDelete, url, options...)
	if err != nil {
		return nil, err
	}
	return request.Do()
}

func Options(url string, options ...Option) (*Response, error) {
	request, err := NewRequest(http.MethodOptions, url, options...)
	if err != nil {
		return nil, err
	}
	return request.Do()
}

func Trace(url string, options ...Option) (*Response, error) {
	request, err := NewRequest(http.MethodTrace, url, options...)
	if err != nil {
		return nil, err
	}
	return request.Do()
}
